package com.wangzeqi.changliaoba.messege;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.NetworkImageView;
import com.android.volley.toolbox.Volley;
import com.parse.GetCallback;
import com.parse.GetDataCallback;
import com.parse.ParseException;
import com.parse.ParseFile;
import com.parse.ParseObject;
import com.parse.ParseQuery;

/**
 * Created by dllo on 16/3/7.
 */
public class test extends AppCompatActivity {
    private NetworkImageView imageView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        ParseObject po = new ParseObject("wahaha");
//        ParseFile parseFile = new ParseFile();
//        po.put("image",parseFile);
//        Bitmap bp = BitmapFactory.decodeResource();
//        ParseQuery<ParseObject> pq = ParseQuery.getQuery("username");
//        pq.getFirstInBackground(new GetCallback<ParseObject>() {
//            @Override
//            public void done(ParseObject object, ParseException e) {
//                ParseFile file = object.getParseFile("user_headicon");
//                file.getDataInBackground(new GetDataCallback() {
//                    @Override
//                    public void done(byte[] data, ParseException e) {
//                        //转换成数组
//                        Bitmap bitmap = BitmapFactory.decodeByteArray(data,0,data.length);
//                        imageView.setImageBitmap(bitmap);
//                    }
//                });
//                String url = file.getUrl();
////                imageView.setImageUrl(url,new ImageLoader(Volley.newRequestQueue(test.this,)));
//            }
//        });

    }
}
